﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Meqs.Entity
{
    [Serializable]
    public class ClassHistory
    {
        private int _rID;
        private int _classID;
        private int _schoolYear;
        private string _schoolMark;

        public ClassHistory()
        {
        }

        public ClassHistory(int rID, int classID, int schoolYear, string schoolMark)
        {
            _rID = rID;
            _classID = classID;
            _schoolYear = schoolYear;
            _schoolMark = schoolMark;
        }

        public int RID
        {
            get { return _rID; }
            set { _rID = value; }
        }

        public int ClassID
        {
            get { return _classID; }
            set { _classID = value; }
        }

        public int SchoolYear
        {
            get { return _schoolYear; }
            set { _schoolYear = value; }
        }

        public string SchoolMark
        {
            get { return _schoolMark; }
            set { _schoolMark = value; }
        }

        public bool Equals(ClassHistory other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other._rID == _rID;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (ClassHistory)) return false;
            return Equals((ClassHistory) obj);
        }

        public override int GetHashCode()
        {
            return _rID;
        }
    }
}
